package cn.jkgly.utils;


import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;


/**
 * 模拟微信返回数据，开始模拟操作的入口
 */
@WebServlet(name = "testServlet", urlPatterns = "/callBackTest")
public class testServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
//        JSONObject userInfo = JSON.parseObject("{\"country\":\"阿富汗\",\"unionid\":\"oDpsLwbijqpp6DJpqW9fk7HFRyHg\",\"province\":\"\",\"city\":\"\",\"openid\":\"oQtMMwiyRaeP-zQL9CFiOQS9Hvis\",\"sex\":1,\"nickname\":\"coder\",\"headimgurl\":\"http://thirdwx.qlogo.cn/mmopen/vi_32/weAiau4Q7GdES9GtHAVXpVic0Ssib4eFCPIyyZCRAANX9K6fZFsGw8paibtmQyOic7LVoCpJojT5s9mPicmLjzxaZ6fw/132\",\"language\":\"zh_CN\",\"privilege\":[]}");
//        req.setAttribute("info",userInfo);
//        System.out.println(userInfo);
//        req.getRequestDispatcher("/register").forward(req,resp);
    }
}

